package br.com.absolutech.study.chapter7.pag339;

import java.util.ArrayList;
import java.util.List;

public class AnimalDoctorGeneric {

	public void addAnimal(List<? super Dog> animals) {
		animals.add(new Dog()); //em alguns casos eh correto adicionar com super
	}

	public static void main(String[] args) {
		List<Animal> animals = new ArrayList<Animal>();
		animals.add(new Dog());
		animals.add(new Dog());
		AnimalDoctorGeneric doc = new AnimalDoctorGeneric();
		doc.addAnimal(animals);
	}
}
